<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let p = new Promise(function (resolve, reject) {
            setTimeout(() => {
                resolve(2000)//presolve的实参 就是成功的结果
                // reject(2000)
                console.log(p);
            }, 3000);
        })

        console.log(p);
        p.then(r => {
            console.log(r);//就是成功的结果
        })



        async function box() {
            // await 返回值 就是 成功的 结果
            let r1 = await new Promise(function (r, j) {
                setTimeout(() => {
                    r(2000)
                }, 2000);
            })
            console.log(r1);
        }
        box()


    </script>

</body>

</html>